<?php
$appConfig = Zend_Registry::get( "appConfig" );
$domConfig = Zend_Registry::get( "domConfig" );
?>
<?php if(count($this->datos)>0):?>
<form action="<?php echo $this->baseUrl("/autoevaluacion/preguntas/asignarCaracteristicas");?>" method="post" class="form-horizontal">
<input type="hidden" name="codelementolista" value="<?php echo $this->codelementolista;?>" />
<?php foreach ($this->datos as $index => $value):?>
    <?php if(count($value["elementos"]) >0):?>
		<h3><?php echo $value["nombre"];?></h3>
		<?php //Zend_Debug::dump($value["elementos"]);?>
		<?php foreach ($value["elementos"] as $caracteristica):
		        $checked = in_array($caracteristica["codelementolista"], $this->asignadas) ? "checked" : "";
		?>
		<div class="checkbox">
		  <label>
		    <input type="checkbox" name="caracteristicas[]" value="<?php echo $caracteristica["codelementolista"];?>" <?php echo $checked;?> />
		    <?php echo $caracteristica["texto"];?>
		  </label>
		</div>
		<?php  endforeach;?>
    <?php  endif;?>
<?php  endforeach;?>
<div class="buttons" style="margin-top: 20px;"><input type="submit" value="Guardar asociación" class="btn btn-warning btn-sm"  /></div>
</form>
<?php else:?>
<br/>
<?php echo $this->mensajes("Primero debe asignar una lista de factores");?>
<?php endif;?>